<?php

namespace app\model\course\ware;

use app\model\company\Company;
use app\model\teacher\Teacher;
use app\model\TimeModel;
use think\model\Relation;

class Courseware extends TimeModel
{
    protected $table = 'sj_courseware';
    protected $json = ['topic_ids'];
    protected $jsonAssoc = true;

    public function teacher(): Relation
    {
        return $this->hasOne(Teacher::class, 'id', 'teacher_id');
    }

    public function company(): Relation
    {
        return $this->belongsTo(Company::class, 'company_id', 'id');
    }
}